package com.online.fund.service;

import java.util.Set;

import javax.annotation.Resource;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.online.fund.spider.dao.SharesMoniterConfigDao;

@Service
public class HolidayService {
	
	@Resource
	private SharesMoniterConfigDao configDao;

	@Cacheable(value = "holidays")
	public Set<String> getHolidays() {
//		System.out.println("query db...");
//		Set<String> holidaySet = new HashSet<String>();
//		holidaySet.add("2018-02-15");
		Set<String> holidaySet = configDao.getHolidaySet();
		return holidaySet;
	}
	
	/**
	 * 清除所有缓存中的数据
	 */
	@CacheEvict(cacheNames="holidays", allEntries=true)
	public void cleanHolidaysCache() {
		
	}
}
